package day05;

public class ArrayDemo {
    public static void main(String[] args) {
         int[] arr=new int[5];
        for (int i = 0; i <arr.length; i++) {
            arr[i]=(int)(Math.random()*100+1);//赋值0——100的随机数
            System.out.println(arr[i]);
        }

 /*  int[] arr1 =new int[]{1,2,3,4,5,};
        arr1=new int[]{1,5,7,4,3,4};//这种声明法可以分开写
        int[] arr2 ={2,4,6,6,7,7};//这种声明法不可以分开写


        int[] arr =new int[3];
        System.out.println(arr.length);
        arr[1]=34;
        arr[2]=345;
        //arr[3]=34;数组下标越界异常*/
    }
}
